%% FUNCTION: calcEmptyWeightLb
% Function that calculates the aircraft empty weight, according to the
%    material and historical data
%
% INPUT:
%   aircraft
%       structureMaterial [int]: 1 for composite; 0 for metal
%       maxTakeOff [int]
%   emptyWeightHistoricalCoeffs
%       A [int]: coefficient
%       c [int]: power
% OUTPUT:
%   emptyWeightLb [int]
%
% AUTHOR: Renato Honda
% REVISION: 1
%

function [weW0] = calcEmptyWeightLb (aircraft, emptyWeightHistoricalCoeffs)

A = emptyWeightHistoricalCoeffs.A;
c = emptyWeightHistoricalCoeffs.c;
mtow = aircraft.weights.mtow;

if strcmp (aircraft.structureMaterial, 'alum')
    material = 0;
elseif strcmp (aircraft.structureMaterial,'inox')
    material = 0;
elseif strcmp (aircraft.structureMaterial,'comp')
    material = 1;
elseif strcmp (aircraft.structureMaterial,'carb')
    material = 0;
end

% if the material is composite, multiply the empty weight by 95%
weW0 = (0.95 ^ material) * A * ( mtow ^ c );

return